﻿using System.Collections.Generic;
using System.Linq;
using Library.Models;

namespace Ecommerce.Models
{
    public class ProductCategoryViewModel
    {
        public ProductCategoryViewModel(ProductCategory productCategory, bool hasLoadProducts)
        {
            Id = productCategory.Id;
            ProductCategoryCultures = productCategory.ProductCategoryCultures.ToArray();
            if (hasLoadProducts)
            {
                Products = productCategory.Products;                
            }
        }

        public int Id { get; set; }

        public ICollection<ProductCategoryCulture> ProductCategoryCultures { get; set; }
        public ICollection<Product> Products { get; set; }
    }

    public class BrandViewModel
    {
        public BrandViewModel(Brand brand)
        {
            Id = brand.Id;
            BrandCultures = brand.BrandCultures.ToArray();
        }

        public int Id { get; set; }

        public  ICollection<BrandCulture> BrandCultures { get; set; }
    }
}